package com.lujianfei.powerinput.database;

import com.orm.SugarRecord;
import com.orm.dsl.Column;
import com.orm.dsl.Table;

import android.os.Parcel;
import android.os.Parcelable;

@Table(name = "NoteItemFieldModel")
public class NoteItemFieldModel extends SugarRecord implements Parcelable {

    @Column(name="noteItemId")
    private
    long noteItemId;

    @Column(name="className")
    private
    String className;

    @Column(name="key")
    private
    String key;

    @Column(name="value")
    private
    String value;

    @Column(name = "widgetName")
    private
    String widgetName;

    public NoteItemFieldModel() {
    }

    protected NoteItemFieldModel(Parcel in) {
        setId(in.readLong());
        noteItemId = in.readLong();
        className = in.readString();
        key = in.readString();
        value = in.readString();
        widgetName = in.readString();
    }
    public String getWidgetName() {
        return widgetName;
    }

    public void setWidgetName(String widgetName) {
        this.widgetName = widgetName;
    }
    public long getNoteItemId() {
        return noteItemId;
    }

    public void setNoteItemId(long noteItemId) {
        this.noteItemId = noteItemId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(getId());
        dest.writeLong(noteItemId);
        dest.writeString(className);
        dest.writeString(key);
        dest.writeString(value);
        dest.writeString(widgetName);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<NoteItemFieldModel> CREATOR = new Creator<NoteItemFieldModel>() {
        @Override
        public NoteItemFieldModel createFromParcel(Parcel in) {
            return new NoteItemFieldModel(in);
        }

        @Override
        public NoteItemFieldModel[] newArray(int size) {
            return new NoteItemFieldModel[size];
        }
    };
}
